home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group99a.txt / 000086_icon-group-sender _Mon Apr 5 13:21:17 1999.msg < prev    next >
Internet Message Format  |  2000-09-20  |  2KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id NAA02050
  4.     for icon-group-addresses; Mon, 5 Apr 1999 13:21:09 -0700 (MST)
  5. Message-Id: <199904052021.NAA02050@baskerville.CS.Arizona.EDU>
  6. X-Authentication-Warning: pluto.mscc.huji.ac.il: mslamm owned process doing -bs
  7. Date: Mon, 5 Apr 1999 20:08:26 +0300 (WET)
  8. From: Ehud Lamm <mslamm@mscc.huji.ac.il>
  9. To: Todd Proebsting <toddpro@microsoft.com>
  10. cc: icon-group@optima.CS.Arizona.EDU
  11. Subject: RE: How programs fail
  12. Errors-To: icon-group-errors@optima.CS.Arizona.EDU
  13. Status: RO
  14.  
  15. On Mon, 5 Apr 1999, Todd Proebsting wrote:
  16.  
  17. > I like Icon's model of what is failure and what is an error, although I,
  18. > too, have been nailed by a failing expression that in a particular context
  19. > is fatal to my application.  To find such, I use the following pattern:
  20. >     f := open(filename) | runerr(500, filename)
  21. > runerr(500) is for "Programmer-Specified Errors" and reports "program
  22. > malfunction", which is precisely what you want in this circumstance.
  23. > Getting the stack trace is useful.
  24.  
  25. The actuall code looked like this:
  26.  
  27. o := if fn == "-" then &output else
  28.  open(fn||"l","w") | stop("Can't open output file \"",fn||"l,"\"")
  29.  
  30. Also, as I said I ran it with a trace, which didn't show anything
  31. relevant.
  32.  
  33. I too am fond of "failure as a programming sitation." In this case it is
  34. like excpetions in other language, but of course the goal directed nature
  35. of Icon makes it much more powerful.
  36.  
  37. Ehud Lamm     mslamm@pluto.mscc.huji.ac.il
  38. http://www2.cybercities.com/e/ehud     <== E-List, Ada, SE and more.
  39.  
  40.